package xyz.zq.sf.common.log;

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import xyz.zq.sf.common.log.aspect.SysLogAspect;
import xyz.zq.sf.common.log.event.SysLogListener;

/**
 * 日志自动配置
 *
 * @author hzq
 * @date 2021-02-05 10:43
 */
@EnableAsync
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication
public class LogAutoConfiguration {

    @Bean
    public SysLogAspect sysLogAspect() {
        return new SysLogAspect();
    }

    @Bean
    public SysLogListener sysLogListener() {
        return new SysLogListener();
    }
}
